home *** CD-ROM | disk | FTP | other *** search
/ GFX Sensations 1 / Graphic Sensations - Volume 1.iso / com_net / mail / thor / thor.lha / rexx / RePost.thor < prev    next >
Encoding:
Text File  |  1994-08-06  |  1.3 KB  |  68 lines

  1. /* Poster current message på en annen BBS */
  2.  
  3. def_bbsname = "UTBBS"
  4. def_conf    = "ChitChat"
  5.  
  6. options results
  7.  
  8. if(substr(address(),1,4) ~= "THOR") then do
  9.     parse arg portname
  10.     if~(show(p, portname)) then do
  11.         if ~(show(p, "THOR.01")) then do
  12.             say "No THOR port found!"
  13.             exit
  14.         end
  15.         else portname = "THOR.01"
  16.     end
  17. end
  18. else portname = address()
  19.  
  20. address(portname)
  21.  
  22. address command "delete >NIL: <NIL: t:repost.msg"
  23. savemessage current noheader filename "t:RePost.msg"
  24.  
  25. subj = getsubj()
  26. say subj
  27.  
  28. do forever
  29.     REQUESTLIST BBSLIST
  30.     bbsname = result
  31.     if(rc ~= 0|bbsname = "") then bbsname = def_bbsname
  32.  
  33.     REQUESTLIST CONFLIST BBS '"'bbsname'"'
  34.     confname = result
  35.     if(rc ~= 0) then confname = def_conf
  36.  
  37.     fname = "t:RePost.msg"
  38.      ADDEVENT BBS '"'bbsname'"' EVENT ENTERMSG SENDTO '"'all'"' CONF '"'confname'"' MSGFILE '"'fname'"' SUBJECT '"'subj'"'
  39.     if(rc ~= 0) then REQUESTNOTIFY TEXT '"Failed to post this time, try again?"' BT '"_Yes|_No"'
  40.     else do 
  41.         PACKEVENTS '"'bbsname'"'
  42.         return
  43.     end
  44. end
  45.  
  46. return
  47.  
  48.  
  49. getsubj:
  50.     if open(fh, "t:RePost.msg") then do 
  51.         do i = 1 to 6
  52.             subj = readln(fh)
  53. say i subj
  54.             if instr(subj, subject) then do 
  55.                 call close(fh)
  56.                 return(delstr(subj, 1, 9))
  57.             end
  58.         end
  59.         call close(fh)
  60.     end
  61. return subj
  62.  
  63. instr: procedure
  64.     parse arg; str = upper(arg(1)); pat = upper(arg(2))
  65.     instring = pos(pat, str); if instring > 0 then return 1
  66.     else return 0
  67. return 0
  68.